package com.guan.ioc.config;

import com.guan.ioc.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class UserInfoConfig {

//    @Primary
    @Bean(name = {"user1", "zhangsan"})
    public UserInfo user1() {
        UserInfo userInfo = new UserInfo(1, "zhangsan", 12);
        return userInfo;
    }

    @Bean
    public UserInfo user2() {
        UserInfo userInfo = new UserInfo(2, "lisi", 13);
        return userInfo;
    }
}
